package com.itheima.zookeeper;

import org.junit.Test;

/**
 * @author ：yuan_he_song
 * 分布式job
 */
// @Component
public class MasterResolveTest {

    // @Scheduled(cron = "10 * * * * ?")
    @Test
    public void  MasterTest() throws InterruptedException {
        MasterResolve instance = MasterResolve.getInstance();
        boolean master = MasterResolve.isMaster();
        if (master){
            // 执行任务...
            System.out.println("任务被我执行了...");
        }
        System.out.println("master:" + master);
        Thread.sleep(Long.MAX_VALUE);
    }
}
